<!-- 主要活动断层制图区-面 -->
<template>
    <el-drawer v-model="addDrawer" size="50%" :show-close="false" @opened="openDrawer" @close="closeDrawer">
        <template #title>
            <el-space direction="vertical" class="space-width100">
                <div v-if="route.path.includes('dataIntegrate') && form.qcOpinion">
                    <el-form :model="form" :inline="true" label-width="140px">
                        <el-form-item label="质检不通过原因" style="width: 100%">
                            <el-input v-model="form.qcOpinion" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" resize="none"
                                clearable></el-input>
                        </el-form-item>
                    </el-form>
                </div>
                <h2>
                    <el-row justify="space-between">
                        <span><svg-icon icon-class="list"></svg-icon><span style="padding-left: 15px">{{ typeName }}</span></span>
                        <div>
                            <el-button type="primary" @click="confirmClick" :disabled="drawerLoading" v-if="isShowSave">保存</el-button>
                            <el-button type="primary" @click="closeDrawer">关闭</el-button>
                        </div>
                    </el-row>
                </h2>
            </el-space>
        </template>
        <template #default>
            <el-form :model="form" ref="addRef" :inline="true" :rules="formRules" label-width="200px"
                v-loading="drawerLoading">
                <el-row justify="space-between">
                    <el-form-item label="省">
                        <el-input v-model="form.province" clearable disabled></el-input>
                    </el-form-item>
                    <el-form-item label="市">
                        <el-input v-model="form.city" clearable disabled></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="区/县">
                        <el-input v-model="form.county" clearable disabled></el-input>
                    </el-form-item>
                    <el-form-item label="编号" prop="id">
                        <el-input v-model="form.id" placeholder="请输入编号" clearable maxlength="17"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="目标区编号" prop="targetRegionId">
                        <el-input v-model="form.targetRegionId" placeholder="请输入目标区编号" clearable maxlength="17"></el-input>
                    </el-form-item>
                    <el-form-item label="项目名称" prop="projectName">
                        <el-input v-model="form.projectName" placeholder="请输入项目名称" clearable maxlength="100"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="地质填图面积 [km²]" prop="mappingArea">
                        <el-input v-model="form.mappingArea" placeholder="请输入地质填图面积 [km²]" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="研究断层总数" prop="studiedFaultCount">
                        <el-input v-model="form.studiedFaultCount" placeholder="请输入研究断层总数" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="活动断层条数" prop="afaultCount">
                        <el-input v-model="form.afaultCount" placeholder="请输入活动断层条数" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="遥感影像处理数目" prop="rsProcess">
                        <el-input v-model="form.rsProcess" placeholder="请输入遥感影像处理数目" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="野外观测点数" prop="fieldSvyPtCount">
                        <el-input v-model="form.fieldSvyPtCount" placeholder="请输入野外观测点数" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="探槽数" prop="trenchCount">
                        <el-input v-model="form.trenchCount" placeholder="请输入探槽数" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="探测总土方量 [m³]" prop="trenchVolume">
                        <el-input v-model="form.trenchVolume" placeholder="请输入探测总土方量 [m³]" clearable maxlength="8"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="钻孔数" prop="drillCount">
                        <el-input v-model="form.drillCount" placeholder="请输入钻孔数" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="钻孔进尺 [米]" prop="drillLength">
                        <el-input v-model="form.drillLength" placeholder="请输入钻孔进尺 [米]" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="地球物理测井数" prop="gphWellCount">
                        <el-input v-model="form.gphWellCount" placeholder="请输入地球物理测井数" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="采集样品总数" prop="collectedSampleCount">
                        <el-input v-model="form.collectedSampleCount" placeholder="请输入采集样品总数" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="送样总数" prop="sampleCount">
                        <el-input v-model="form.sampleCount" placeholder="请输入送样总数" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="获得测试结果样品数" prop="datingSampleCount">
                        <el-input v-model="form.datingSampleCount" placeholder="请输入获得测试结果样品数" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="微地貌测量工程总数" prop="geomorphySvyProjectCount">
                        <el-input v-model="form.geomorphySvyProjectCount" placeholder="请输入微地貌测量工程总数" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="地震监测工程数" prop="seismicProjectCount">
                        <el-input v-model="form.seismicProjectCount" placeholder="请输入地震监测工程数" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="地形变监测工程数" prop="crustalDfmProjectCount">
                        <el-input v-model="form.crustalDfmProjectCount" placeholder="请输入地形变监测工程数" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="地球物理探测工程数" prop="geophysicalSvyProjectCount">
                        <el-input v-model="form.geophysicalSvyProjectCount" placeholder="请输入地球物理探测工程数" clearable maxlength="4"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="地球化学探测工程数" prop="geochemicalProjectCount">
                        <el-input v-model="form.geochemicalProjectCount" placeholder="请输入地球化学探测工程数" clearable maxlength="4"></el-input>
                    </el-form-item>
                    <el-form-item label="是否火山地质调查填图" prop="isVolcanic">
                        <el-radio-group v-model="form.isVolcanic">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="0">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="是否开展地震危险性评价" prop="sra">
                        <el-radio-group v-model="form.sra">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="0">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="是否开展地震危害性评价" prop="sda">
                        <el-radio-group v-model="form.sda">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="0">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="是否开展断层三维数值模拟" prop="sda">
                        <el-radio-group v-model="form.isNumSimulation">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="0">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="描述信息" prop="description" style="width:100%">
                        <el-input v-model="form.description" placeholder="请输入描述信息" :autosize="{ minRows: 3, maxRows: 6 }"
                            type="textarea" show-word-limit maxlength="255" clearable></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="显示码" prop="showCode">
                        <el-input v-model="form.showCode" placeholder="请输入显示码" clearable maxlength="10"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="备注" prop="commentInfo" style="width:100%">
                        <el-input v-model="form.commentInfo" placeholder="请输入备注" :autosize="{ minRows: 6, maxRows: 12 }"
                            type="textarea" show-word-limit maxlength="2147483647" clearable></el-input>
                    </el-form-item>
                </el-row>
            </el-form>
        </template>
    </el-drawer>
</template>
<script setup>
// 引入基础方法
import useSpatialData from '@/hooks/useSpatialData';
// 引入表单验证规则
import { eightDouble, fourInt } from '@/utils/validate';
const { route, addDrawer, drawerLoading, form, typeName, openDrawer, closeDrawer, confirmClick, uploadSuccess, deleteFile, isShowSave } = useSpatialData();
// 表单验证规则
const formRules = {
    id: [{ required: true, message: '请输入编号！', trigger: 'blur' }],
    targetRegionId: [{ required: true, message: '请输入目标区编号！', trigger: 'blur' }],
    projectName: [{ required: true, message: '请输入项目名称！', trigger: 'blur' }],
    mappingArea: [fourInt],
    trFaultCount: [fourInt],
    studiedFaultCount: [fourInt],
    afaultCount: [fourInt],
    rsProcess: [fourInt],
    fieldSvyPtCount: [fourInt],
    trenchCount: [fourInt],
    trenchVolume: [eightDouble],
    drillCount: [fourInt],
    drillLength: [fourInt],
    gphWellCount: [fourInt],
    collectedSampleCount: [fourInt],
    sampleCount: [fourInt],
    datingSampleCount: [fourInt],
    geomorphySvyProjectCount: [fourInt],
    seismicProjectCount: [fourInt],
    crustalDfmProjectCount: [fourInt],
    geophysicalSvyProjectCount: [fourInt],
    geochemicalProjectCount: [fourInt],
    numSimulationCount: [fourInt],
}
</script>
<style lang="scss" scoped></style>